local ty_1v2_jl = fk.CreateSkill {
    name = "ty_1v2_jl&",
    anim_type = "offensive",
}

Fk:loadTranslationTable {
    ["ty_1v2_jl&"] = "江陵",
    [":ty_1v2_jl&"] = "出牌阶段开始时，你选择普通锦囊牌和基本牌于本回合使用时：1.额外指定一个目标且额外目标无法响应此牌，2.无次数和距离限制。",

    ["ty_1v2_jl_nfc"] = "可额外选择目标",
    ["ty_1v2_jl_wxy"] = "无次数距离限制",
    ["#ty_1v2_jl-choose"] = "江陵：请选择%arg的额外目标",
}

ty_1v2_jl:addEffect(fk.EventPhaseStart, {
    can_trigger = function(self, event, target, player, data)
        return target == player and player:hasSkill(ty_1v2_jl.name) and player.phase == Player.Play
    end,
    on_use = function(self, event, target, player, data)
        local room = player.room
        local choices = { "ty_1v2_jl_nfc", "ty_1v2_jl_wxy" }
        local choice = room:askToChoice(player, {
            choices = choices,
            skill_name = ty_1v2_jl.name,
            prompt = "江陵：请选择一项"
        })
        room:setPlayerMark(player, "ty_1v2_jl-turn", choice)
    end,
})
ty_1v2_jl:addEffect(fk.AfterCardTargetDeclared, {
    is_delay_effect = true,
    can_trigger = function(self, event, target, player, data)
        return target == player and player:getMark("ty_1v2_jl-turn") ~= 0 and
            player:getMark("ty_1v2_jl-turn") == "ty_1v2_jl_nfc" and
            (data.card.type == Card.TypeBasic or data.card:isCommonTrick()) and
            #data:getExtraTargets() > 0
    end,
    on_cost = function(self, event, target, player, data)
        local room = player.room
        local tos = room:askToChoosePlayers(player, {
            targets = data:getExtraTargets(),
            min_num = 1,
            max_num = 1,
            prompt = "#ty_1v2_jl-choose:::" .. data.card:toLogString(),
            skill_name = ty_1v2_jl.name,
        })
        if #tos > 0 then
            room:sortByAction(tos)
            event:setCostData(self, { tos = tos })
            return true
        end
    end,
    on_use = function(self, event, target, player, data)
        data.disresponsiveList = data.disresponsiveList or {}
        for _, p in ipairs(event:getCostData(self).tos) do
            data:addTarget(p)
            table.insertIfNeed(data.disresponsiveList, p)
        end
    end,
})
ty_1v2_jl:addEffect("targetmod", {
    bypass_times = function(self, player, skill, scope, card, to)
        return card and player:getMark("ty_1v2_jl-turn") == "ty_1v2_jl_wxy"
    end,
    bypass_distances = function(self, player, skill, card, to)
        return card and player:getMark("ty_1v2_jl-turn") == "ty_1v2_jl_wxy"
    end,
})

return ty_1v2_jl
